release: v10.12.0 — JP3D batched bridge extension to partial-res + ROI#448
Merged
Conversation
Closes the v10.11.0 known limitation. The batched bridge SPI now
handles K>0 partial-resolution and ROI cases inside
JP3DSliceStackCodec via a new JP3DBridgeOptions overload — the
v10.11.0 architecture extends naturally with a single options
struct that rides through the bundle.
JP3D full-decode + partial-res + ROI wins (M2 release, --jp3d
bench, in-process, 7 runs / 2 warmups, median):
Fixture vx full Δ ms res1 Δ ms ROIq Δ ms
--------------------------------------------------------------
mr_3d_small 262K −0.05 +1.86 −0.02
ct_3d_small 1.05M **−4.19** −0.32 −2.19
us_3d_small 1.84M **−4.69** +1.25 −2.73
mr_3d_mid 2.10M **−9.35** −1.63 **−4.22**
ct_3d_mid 8.39M **−38.85** **−10.44** **−21.18**
ct_3d_large 16.78M **−82.89** **−25.82** **−47.53**
Per acceptance discipline (≥3 ms wins): full 4/6, res1 2/6,
ROIq 3/6 fixtures clear. Smaller fixtures wash on the lighter
lanes (reduced workload leaves less to amortise). Both 8M+ CT
volumes (radiologist scrolling case) win on every lane.
Architectural surface — new opaque options:
• JP3DBridgeOptions(partialResolutionLevel:, regionOfInterest:)
• J2KDecoder._jp3dDecodeToCoefficients(_:Data, options:JP3DBridgeOptions)
Pipeline:
• DecoderPipeline.decodeToCoefficients(_:Data, options:) sets
partialResolutionLevel + regionOfInterest before extractTileData,
captures options into the returned bundle.
• iDWTAndFinalizeCoefficients honours captured options:
partial-res → sets outputDimensions for reconstructImage;
ROI → post-iDWT crop via Self.cropImage.
• iDWTAndFinalizeCoefficientsBatched eligibility gate now accepts
uniform partial-res K + ROI across the batch. Orchestrator
truncates the chain to effectiveLevels = N − K for partial-res;
runs full chain for ROI then per-slice crops. K=0 thumbnail
falls back to per-slice serial (no iDWT chain to dispatch).
JP3DSliceStackCodec wiring:
• Removes the (K>0 || ROI) → per-slice-serial fallback in the
bulk batched path. Both branches now build a JP3DBridgeOptions,
decode all slices to coefficients in parallel via the new
overload, then run ONE batched iDWT + finalize.
• The (K>0 AND ROI) compositional throw still fires (2D codec
doesn't compose those — separate arc).
• Env-var off-switch J2K_JP3D_BATCHED_BRIDGE=0 still works.
Validation:
- V10_21_BatchedBridgeOptionsParityTests 7/7 PASS
(K=0/2/4/N, ROI 128² and 64², K+ROI composition)
- V10_20_BatchedBridgeParityTests 5/5 PASS
- V10_20_BatchedInverseInt32ParityTests 12/12 PASS
- V10_20_JP3DBridgeParityTests 5/5 PASS
- `swift test --filter JP3D` regression 519/519 PASS
- Mandatory commit gate (release mode) 7/7 PASS
Codestream bytes byte-identical to v10.11.0; encoder unchanged.
MINOR per RELEASING.md — additive public surface, no removals,
no default flip that affects bytes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JP3DDecoder(cfg).decodewithcfg.resolutionLevel > 0andJP3DROIDecoder().decode(data, region:)now both run ONE batched iDWT dispatch instead of N per-slice dispatches.Correctness gate (release mode)
V10_21_BatchedBridgeOptionsParityTestsV10_20_BatchedBridgeParityTestsV10_20_BatchedInverseInt32ParityTestsV10_20_JP3DBridgeParityTestsswift test --filter JP3DregressionJ2KMedicalCorpusEncodePerformanceTestsJ2KMedicalCorpusPerformanceTestsJ2KStrictCrossCodecValidationTestsTest plan
Companion documents
RELEASE_NOTES_v10.12.0.md— full release notesDocumentation/Benchmarks/data/jp3d-bench-arm64-v10_21-batched-20260524.json— A/B raw (batched)Documentation/Benchmarks/data/jp3d-bench-arm64-v10_21-serial-20260524.json— A/B raw (serial baseline)v10.21-researchbranch perfeedback_research_no_main_merge.md.🤖 Generated with Claude Code